﻿using Health.Code;
using Health.Domain;
using Health.WebAPI.Read.Applicant.Command;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Health.WebAPI.Read.Controllers
{
    /// <summary>
    /// 健康咨询-读
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class HealthController : ControllerBase
    {
        /// <summary>
        /// 中介者
        /// </summary>
        IMediator mediator;
        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="mediator"></param>
        public HealthController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 显示栏目信息
        /// </summary>
        /// <param name="show"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<APIRestl<List<Column>>> ShowColumn([FromQuery] ShowColmunCommand show)
        {
            return mediator.Send(show);
        }
        /// <summary>
        /// 显示医生信息
        /// </summary>
        /// <param name="doctor"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<APIRestl<List<Doctor>>> ShowDoctor([FromQuery] DoctorCommand doctor)
        {
            return mediator.Send(doctor);
        }
        /// <summary>
        /// 价目列表
        /// </summary>
        /// <param name="pricelist"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<APIRestl<List<Pricelist>>> ShowPrice()
        {
            ShowPricelistCommand pricelist=new ShowPricelistCommand();
            return mediator.Send(pricelist);
        }
        /// <summary>
        /// 就医指南列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public Task<APIRestl<List<MedicalGuide>>> MedicalShow()
        {
            MedicalGuideShowCommand medical=new MedicalGuideShowCommand();
            return mediator.Send(medical);
        }
    }
}
